package com.rxz.controller;

import com.rxz.entity.Result;
import com.rxz.service.impl.ZsetServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/zset")
@CrossOrigin
public class ZsetController {

    @Autowired
    private ZsetServiceImpl zsetService;

    @GetMapping("/all")
    public Result getAll(){
        return zsetService.getAllScore();
    }

    @PostMapping("/one")
    public Result getOne(@RequestParam Integer id){
        return zsetService.getOne(id);
    }

    @PostMapping("/add")
    public Result addZset(){
        return zsetService.addZset();
    }
}
